/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						 artifact_prop_attack.h

	$Header: /heroes4/artifact_prop_attack.h $

	$NoKeywords: $

 ************************************************************************/

#if !defined( ARTIFACT_PROP_ATTACK_H_INCLUDED )
#define ARTIFACT_PROP_ATTACK_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <iosfwd>

namespace t_artifact_prop
{
	// ----------------------------------------------------------------------
	// class for combat effects
	// ----------------------------------------------------------------------
	class t_attack 
	{
	public:
		bool affects( bool ranged ) const;
		bool affects_melee() const;
		bool affects_ranged() const;
		bool read( std::streambuf& buffer );
		void set_melee( bool arg = true );
		void set_ranged( bool arg = true );
		bool write( std::streambuf& buffer ) const;
	protected:
		bool m_affects_melee;
		bool m_affects_ranged;
	};

	inline bool t_attack::affects( bool ranged ) const
	{
		if (ranged)
			return m_affects_ranged;
		return m_affects_melee;
	}

	inline bool t_attack::affects_melee() const
	{
		return m_affects_melee;
	}

	inline bool t_attack::affects_ranged() const
	{
		return m_affects_ranged;
	}

	inline void t_attack::set_melee( bool arg )
	{
		m_affects_melee = arg;
	}

	inline void t_attack::set_ranged( bool arg )
	{
		m_affects_ranged = arg;
	}
};

#endif // ARTIFACT_PROP_ATTACK_H_INCLUDED